<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="/Public/admin/css/style.css" rel="stylesheet">
<link href="/Public/admin/css/font-awesome.min.css" rel="stylesheet">
<title>{$title}</title>
</head>

<body>
    <div class="breadNav">
        <ul class="breadNavBar">
            <li><i class="icon-home" style="font-size:16px"></i></li>
            <li><a href="javascript:;" onClick="parent.location.reload('/Admin/Index/index');">首页</a></li>
            <li>&gt;</li>
            <li><a href="/Admin/Menu/index">自定义菜单</a></li>
            <li>&gt;</li>
            <li>菜单列表</li>
        </ul>
    </div>
    <div style="clear:both;"></div>
    <div class="filter">
        <div class="form-group">
			<a class="btn btn-primary btn-lg" id="addBtn" href="javascript:void(0);"><i class="icon-plus"></i>&nbsp;生成菜单</a>
		</div>
        
    </div>
    <div class="tableBox">
    <table class="table">
        <thead>
			<tr>
				<th class="w_20">菜单名称</th>
				<th class="w_20">菜单类型</th>
				<th class="w_40">菜单值</th>
				<th>操作</th>
			</tr>
        </thead>
        <tbody id="dataInfo">
			<tr>
				<td align="left" style="color:#F00">根菜单</td>
				<td align="left" style="color:#F00"></td>
				<td align="left" style="color:#F00"></td>
				<td align="left"><a href="/Admin/Menu/menuAdd/pid/0" class="btn btn-primary exit"><i class="icon-plus"></i>&nbsp;新增</a>
			</tr>            
            <volist name="menuList" id="menuList">
            <tr class="line_g hover_bg">
                <td align="left">
                {$menuList.name}
                </td>
				<td align="left">
                {$menuList.type}
                </td>
				<td align="left">
                {$catList.catname}<if condition="$menuList['type'] eq 'click'">{$menuList.key}<elseif condition="$menuList['type'] eq 'view'"/>{$menuList.url}</if>
                </td>
                <td align="left">
                    <a href="/Admin/Menu/menuAdd/pid/{$menuList.id}" class="btn btn-primary exit"><i class="icon-plus"></i>&nbsp;新增</a>
                    <a href="/Admin/Menu/editCat/id/{$menuList.id}" class="btn btn-primary exit"><i class="icon-edit"></i>&nbsp;编辑</a>
                    <a href="javascript:if(confirm('你确定要删除吗？'))location.href='/Admin/Menu/catDel/id/{$menuList.id}';" class="btn   exit"><i class="icon-remove"></i>&nbsp;删除</a>
                </td>
            </tr>
            </volist>
        </tbody>
    </table>
    </div>
	<div class="pageBarBox">
		{$page}
	</div>
</body>
<script src="/Public/js/jquery.min.js?ver=1.8.3"></script>
<script src="/Public/admin/js/main.js"></script>
<script src="/Public/js/titleMes.js"></script>
<script>
$(function () {
	$('#addBtn').click(function () {
		$.ajax({
			type:'post',
			url:'{:U(\'setMenu\')}',
			success:function (data) {
                var obj=eval('('+data+')');
                if(obj.errcode == 0){
                        alert(obj.errmsg);
                }else {
                    alert('设置失败，程序出错');
                }
			},
			error:function () {
				alert('系统异常！');
			}
		})
	})
})
</script>
</html>
